package 设计模式.prototype;

import java.io.IOException;

public class Client {
    public static void main(String[] args) throws CloneNotSupportedException, IOException, ClassNotFoundException {
        Student zs = new Student("张三", 13);
        Student ls = new Student("李四", 14);
        zs.setFriend(ls);
        ls.setFriend(zs);

        // Exception in thread "main" java.lang.StackOverflowError
        // Student cloneZs = zs.clone();

        // Exception in thread "main" java.lang.StackOverflowError
        Student cloneZs = zs.deepClone();


        System.out.println(cloneZs.hashCode() == zs.hashCode());
    }
}
